package com.hopechart.micro.common.exception;

/**
 * @author daijiang@hopechart.com
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1;

    private ErrorCode code = ErrorCode.INNER;

    public BusinessException() {
        super();
    }

    public BusinessException(ErrorCode code) {
        super();
        this.code = code;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(ErrorCode code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(ErrorCode code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(ErrorCode code, Throwable cause) {
        super(cause);
        this.code = code;
    }

    public ErrorCode getCode() {
        return code;
    }

    public void setCode(ErrorCode code) {
        this.code = code;
    }
}
